package com.richman.isn;

import com.richman.controller.DecreseRatio;

public class ISNGrabThread extends Thread {

	public long sleepTime = 30*1000;
	ISNManager isnmanager = null;
	
	
	boolean start = false;
	boolean loginNow = false;
	
	
	boolean bexit = false;
	
	public boolean getbexit() {
		return bexit;
	}

	public ISNGrabThread(){		
		isnmanager = new ISNManager();
		isnmanager.init();
		
	}
	
	
	@Override
    public void run() {

		try{

			while(DecreseRatio.bStartEngine){
				try{
					isnmanager.login();
					isnmanager.checkIsOnline();
					isnmanager.grabEvents();
					//todo 睡眠时间减少
					//Thread.sleep(3000);
					
				}catch(Exception e){
					e.printStackTrace();
					Thread.sleep(2000);
				}
				

			}
			
			ISNManager.ISNTeams.clear();
		
			bexit = true;

		}catch(Exception e){
			e.printStackTrace();
		}	
	}
	
}
